//构建mongoose的数据模型
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoosePaginate = require('mongoose-paginate');

//定义
var userSchema = new mongoose.Schema({
    //schema=模型
    title:String,
    author:String,
    date:{type:Date},
    otherTitle:String,
    imgUrl:String,
    style:[],
    tips:[],
    textarea:String
});

userSchema.plugin(mongoosePaginate);

module.exports = mongoose.model('News',userSchema,'news');
